//路由 
define(["backbone"],function(){
	var router=Backbone.Router.extend({
		routes:{
			//key:value  key 是路由值(访问路径里#后的值)  value 是对应的处理函数名
			"home":"home",
			"delivery":"delivery",
			"reserve":"reserve",
			"shopCar":"shopCar",
			"center":"center",
			"order":"order",
			"integral":"integral",
			"seckill":"seckill",
			"search":"search",
			"location":"location"
		},
		//这里的home对应上面的value
		home:function(){
			console.log("跳转到home");
			require(["modules/home/home"],function(h){
				h.render();
			});
		},
		delivery:function(){
			console.log("跳转到闪送");
			require(["modules/delivery/delivery"],function(h){
				h.render();
			})
		},
		reserve:function(){
			console.log("跳转新鲜预定");
			require(["modules/reserve/reserve"],function(h){
				h.render();
			})
		},
		shopCar:function(){
			console.log("跳转购物车");
			require(["modules/shopCar/shopCar"],function(h){
				h.render();
			})
		},
		center:function(){
			console.log("跳转个人中心");
			require(["modules/center/center"],function(h){
				h.render();
			})
		},
		order:function(){
			console.log("跳转订单");
			require(["modules/order/order"],function(h){
				h.render();
			})
		},
		integral:function(){
			console.log("跳转积分");
			require(["modules/integral/integral"],function(h){
				h.render();
			})
		},
		seckill:function(){
			console.log("跳转秒杀");
			require(["modules/seckill/seckill"],function(h){
				h.render();
			})
		},
		search:function(){
			console.log("跳转搜索");
			require(["modules/search/search"],function(h){
				h.render();
			})
		},
		location:function(){
			console.log("跳转搜索");
			require(["modules/location/location"],function(h){
				h.render();
			})
		}
	});
	
	new router();
});